Agilepy science API tutorial - VELA Region analysis

The purpose of this notebook is to show how to use the Agilepy scientific API.

The complete API documentation can be found at this link.

Importing the library

Creating a configuration file

Initialization of the class

API: configuration file

Print all options of the configuration file

Print a single section of the yaml configuration file

Print a single option

Set some options

API: interacting with the Sources Library

Loading the AGILE's second catalogue of gamma-ray sources

Alternative solution: loading the sources from a custom AGILE .txt file

The sources that are already present in the Sources Library will not be loaded twice.

Selecting the sources

The selection criteria can be expressed using the following Source class’s parameters:

Free/Fix source parameters

You can fix or free the following parametes:

Resetting the changes:

Deleting sources

Adding a source

Passing a dictionary:

Passing a Source object:

Update the value of a spectrum parameter of a source

Fix the hypothesis for the analysis

This method returns the selected sources affected by the change

Final source hypothesis for the analysis

API: generate maps and perform maximum likelihood estimator analysis

Generating maps

Displaying maps

Single figure - multiple subplots

Multiple figures - one subplot per figure

Saving maps

Estimation of background coefficients

You can use the calcBkg() method to estimate the background coefficients.

Maximum likelyhood analysis

Free also position parameter

Save the results of the analysis in a reg file.

Display the result of the analysis saved in a reg file.

Light curve

Fix the position and keep only flux free

Aperture Photometry

Cleaning up